#pragma once
#include "includeCL.h"
#include "AlgorithmInput.h"
#include <boost/shared_ptr.hpp>

namespace Algorithm
{

template<unsigned int OBSERVATION_VECTOR_SIZE, unsigned int NUMBER_OF_OBSERVATIONS, unsigned int NUMBER_OF_CENTROIDS >
class KMeansStandardV1_Util
{
public:
	typedef AlgoritmhInput<OBSERVATION_VECTOR_SIZE, NUMBER_OF_OBSERVATIONS, NUMBER_OF_CENTROIDS >  SupportedAlgorithmInput;

	typedef typename SupportedAlgorithmInput::TObservations TObservations;
	typedef typename SupportedAlgorithmInput::TCentroids TCentroids;
	typedef typename SupportedAlgorithmInput::WrappedArray1<cl_uint,NUMBER_OF_OBSERVATIONS> TClosestCentroid;

	class TAlgorithmData
	{
	public:
		TObservations observations;
		TCentroids currentCentroids;
		TCentroids lastCentroids;
		TClosestCentroid closestCentroid;
		bool convergence;
	};
	typedef boost::shared_ptr<TAlgorithmData> TSpAlgorithmData;
	typedef const boost::shared_ptr<const TAlgorithmData> TConstSpAlgorithmData;

	class GenerateAlgorithmDataRandom
	{
	public:
		static TSpAlgorithmData generate()
		{
			TSpAlgorithmData returned(new TAlgorithmData);
			SupportedAlgorithmInput::generateAlgorithmInputRandom(returned->observations,returned->currentCentroids);
			returned->convergence=false;
			return returned;
		}
	};

};



}//namespace Algorithm











